<template>
  <div class="container">
    <div class="header">
      <h1 class="title">丰子恺大师</h1>
      <p class="subtitle">中国现代画家、漫画家与散文家</p>
    </div>

    <div class="content">
      <!-- 个人简介部分 -->
      <div class="bio" @mouseover="hoverEffect" @mouseleave="resetEffect">
        <p>
          丰子恺，原名丰润，字子恺，江苏无锡人。是中国现代著名画家、漫画家和散文家，他的作品以人文关怀与自然主义为主，尤其擅长儿童画和插画，享有广泛的文化影响力。
        </p>
      </div>

      <!-- 名言展示 -->
      <div class="quotes" v-for="(quote, index) in quotes" :key="index">
        <p class="quote" :class="`quote-${index}`">{{ quote }}</p>
      </div>

      <!-- 人生大事记时间轴 -->
      <div class="timeline">
        <h2>人生大事记</h2>
        <div class="timeline-item" v-for="event in events" :key="event.year">
          <div class="year">{{ event.year }}</div>
          <div class="event">{{ event.description }}</div>
        </div>
      </div>
    </div>

    <div class="footer">
      <p>&copy; 2024 丰子恺纪念站</p>
    </div>
  </div>
</template>

<script>
export default {
  name: "FengZikaiView",
  data() {
    return {
      events: [
        { year: 1898, description: "丰子恺出生于江苏无锡。" },
        { year: 1917, description: "开始创作漫画，成为重要的漫画家。" },
        { year: 1920, description: "出版了《丰子恺漫画》一书，成为知名插画家。" },
        { year: 1930, description: "开始关注儿童画的创作，深受喜爱。" },
        { year: 1975, description: "丰子恺辞世，享年77岁。" },
      ],
      quotes: [
        "'生活不止眼前的苟且，还有诗和远方。'",
        "'真正的美，不在于表面，而在于人的心灵。'",
        "'宁可使人微笑，也不要使人落泪。'"
      ]
    };
  },
  methods: {
    hoverEffect(event) {
      event.target.style.transform = 'scale(1.05)';
      event.target.style.transition = 'transform 0.3s ease-out';
    },
    resetEffect(event) {
      event.target.style.transform = 'scale(1)';
    },
  }
};
</script>

<style scoped>
.container {
  font-family: 'Arial', sans-serif;
  background-color: #f7f7f7;
  color: #333;
  margin: 0;
  padding: 0;
}

.header {
  text-align: center;
  padding: 50px;
  background-color: #ff6f61;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: fadeIn 2s ease-out;
}

.title {
  font-size: 3em;
  font-weight: bold;
  animation: slideIn 2s ease-out;
}

.subtitle {
  font-size: 1.2em;
  margin-top: 10px;
  animation: fadeIn 2.5s ease-out;
}

.content {
  padding: 20px;
}

.bio {
  font-size: 1.2em;
  line-height: 1.6;
  margin-bottom: 30px;
  animation: fadeInUp 1.5s ease-out;
  transform: scale(1);
}

.quotes {
  font-style: italic;
  margin-top: 30px;
}

.quote {
  margin-bottom: 15px;
  opacity: 0;
  animation: fadeInUp 2s ease-out forwards;
}

.quote-0 {
  animation-delay: 1s;
}

.quote-1 {
  animation-delay: 1.5s;
}

.quote-2 {
  animation-delay: 2s;
}

.timeline {
  margin-top: 40px;
}

.timeline-item {
  margin: 15px 0;
  padding: 10px;
  background-color: #e2e2e2;
  border-left: 5px solid #ff6f61;
  animation: slideInUp 2s ease-out;
  transform: translateY(20px);
}

.year {
  font-weight: bold;
  color: #ff6f61;
}

.event {
  margin-top: 5px;
}

.footer {
  text-align: center;
  background-color: #333;
  color: #fff;
  padding: 20px;
  margin-top: 50px;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
</style>
